package com.service.impl;


import com.bean.ChooseCommodity;
import com.bean.Commodity;
import com.dao.ChooseCommodityMapper;
import com.service.ChooseCommodityService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;
@Service("ChooseCommodity")
public class ChooseCommodityServiceImpl implements ChooseCommodityService {


    @Autowired
    private ChooseCommodityMapper chooseCommodityMapper;
    /**
     * 查询单个商品信息
     * 这个查询单个商品的，要弄一个类别下拉框，把类别保存到这里
     * @param chooseCommodity
     * @return
     */
    @Override
    public List<ChooseCommodity> find(ChooseCommodity chooseCommodity) {
        return chooseCommodityMapper.select(chooseCommodity);
}

    /**
     * 查询总记录数
     * @param map
     * @return
     */
    @Override
    public int count(Map<String, Object> map) {
        return chooseCommodityMapper.selectCount(map);
    }

    /**
     * 查询并分页
     * @param map
     * @return
     */
    @Override
    public List<ChooseCommodity> query(Map<String, Object> map) {
        return chooseCommodityMapper.selectByPage(map);
    }
}
